package com.cc.service.Impl;

import com.cc.dao.BaseDao;
import com.cc.dao.Impl.OssDaoImpl;
import com.cc.dao.OssDao;
import com.cc.entity.Oss;
import com.cc.service.OssService;

import java.util.List;

public class OssServiceImpl extends BaseDao implements OssService {
    OssDao ossDao = new OssDaoImpl();
    @Override
    public List<Oss> selectAll() {

        return ossDao.selectAll();
    }

    @Override
    public Oss ossInfo(String bucketName) {

        return ossDao.ossInfo(bucketName);
    }

    @Override
    public boolean add(Oss oss) {
        int count = -1;
        //新增
        count = ossDao.addOss(oss);
        return count > 0 ? true : false;
    }

    @Override
    public boolean updateOss(String name, String permission) {
            int count = ossDao.updateOss(name,permission);
            if (count>=0){
                return true;
            }
            return false;
        }
}
